cmake_minimum_required(VERSION 3.0)

project(PlaneFitting)

find_package(Eigen3 REQUIRED)

aux_source_directory(src SRC)
add_library(${PROJECT_NAME} ${SRC})
target_include_directories(${PROJECT_NAME} PRIVATE ${EIGEN3_INCLUDE_DIR})
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)

aux_source_directory(test TEST)
add_executable(test_${PROJECT_NAME} ${TEST})
target_include_directories(test_${PROJECT_NAME} PRIVATE src ${EIGEN3_INCLUDE_DIR})
target_link_libraries(test_${PROJECT_NAME} PRIVATE ${PROJECT_NAME})

enable_testing()
add_test(NAME test COMMAND test_${PROJECT_NAME})
